home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
cgraphix
/
kdrawcir.c
< prev
next >
Wrap
Text File
|
1986-05-08
|
1KB
|
49 lines
/* «RM120»«PL99999»«TS4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76» */
#include <stdio.h>
#define EXTERN extern
#include <typedef.h>
void DrawCircleDirect(xr, yr, r, DirectModeLoc)
int xr, yr, r, DirectModeLoc;
{
extern double fabs();
static int n = 14;
static int x[] =
{0,0,121,239,355,465,568,663,749,823,885,935,971,993,1000};
int xk1, xk2, yk1, yk2, xp1, yp1, xp2, yp2;
double xfact, yfact;
int i;
xfact = fabs(.001 * (double)r);
yfact = xfact*AspectGlb;
if (xfact > 0.0) {
xk1 = (int)(x[1]*xfact+0.5);
yk1 = (int)(x[n]*yfact+0.5);
for (i = 2; i <= n; i++) {
xk2 = (int)(x[i]*xfact+0.5);
yk2 = (int)(x[n-i+1]*yfact+0.5);
xp1 = xr-xk1;
yp1 = yr+yk1;
xp2 = xr-xk2;
yp2 = yr+yk2;
DrawLinW(xp1,yp1,xp2,yp2, DirectModeLoc);
xp1 = xr+xk1;
xp2 = xr+xk2;
DrawLinW(xp1,yp1,xp2,yp2, DirectModeLoc);
yp1 = yr-yk1;
yp2 = yr-yk2;
DrawLinW(xp1,yp1+1,xp2,yp2+1, DirectModeLoc);
xp1 = xr-xk1;
xp2 = xr-xk2;
DrawLinW(xp1,yp1+1,xp2,yp2+1, DirectModeLoc);
xk1 = xk2;
yk1 = yk2;
}
}
else
DP(xr,yr);
}